all: pdf

pdf: report.pdf minutes.pdf article.pdf slides.pdf requirements.pdf
png: report.png minutes.png article.png slides.png requirements.png

requirements.pdf: requirements.tex essreqs.cls requirements.csv requirements-summary.txt
	@pdflatex $<

report.pdf: report.tex essreport.cls
	@pdflatex $< && pdflatex $<

minutes.pdf: minutes.tex essminutes.cls
	@pdflatex $< && pdflatex $<

article.pdf: article.tex essarticle.cls
	@pdflatex $< && pdflatex $<

slides.pdf: slides.tex beamercolorthemeess.sty  beamerinnerthemeess.sty  beamerouterthemeess.sty  beamerthemeess.sty
	@pdflatex $<

slides.png: slides.pdf
	@convert -density 50 slides.pdf[0] slides.png

%.png: %.pdf
	@convert -density 25 $<[0] $@

clean:
	rm -fv *.pdf *.toc *.out *.log *.aux *.png

attach: report.pdf
	pdftk report.pdf attach_files report.tex output report-with-attachment.pdf
